Target OS: Winodows
 
 
 

Relevance 1:

 
(name of it = "WinXP" OR name of it = "WinXP-2003" OR (name of it = "WinVista" AND product type of it = nt workstation product type AND NOT x64 of it) OR (name of it = "WinVista" AND product type of it = nt workstation product type AND x64 of it) OR (name of it = "Win7" AND NOT x64 of it) OR (name of it = "Win7" AND x64 of it)) of operating system
 
 
 

Action:

 
// SFC relies on the "TrustedInstaller" service: http://www.winhelponline.com/blog/fix-for-error-windows-resource-protection-could-not-start-the-repair-service-when-running-sfc-in-vista/
if{not exists running service "TrustedInstaller"}
waithidden cmd.exe /C net start TrustedInstaller
endif
 
// Run the System File Checker Utility
// http://support.microsoft.com/kb/929833
continue if{exists running service "TrustedInstaller"}
waithidden sfc /scannow
 
 

​References:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/system_file_checker.mspx​
http://www.winhelponline.com/blog/fix-for-error-windows-resource-protection-could-not-start-the-repair-service-when-running-sfc-in-vista/​